CMAKE_MINIMUM_REQUIRED(VERSION 3.22.1)

SET(LIBRARY_OUTPUT_PATH ${BIN_PATH})

SET(build_target "md_gateway")

INCLUDE_DIRECTORIES (
	${BINANCE_H_PATH}
	${COMMON_HEADER_PATH}
)

LINK_DIRECTORIES (
	${BINANCE_LIB_PATH}
)

INCLUDE_DIRECTORIES("../../vcpkg_linux/installed/x64-linux/include")

LINK_DIRECTORIES("../../vcpkg_linux/installed/x64-linux/lib")

# generate project
rw_module_source_all()

add_executable(
	${build_target}
	
	${rw_module_source_list}
)

target_link_libraries (	
	${build_target}

	binance
)

add_definitions(-D_DEBUG)

target_link_libraries(${build_target} -lPocoFoundation -lpcre2-8 -lpthread -lboost_system -lboost_date_time -lcpprest -lssl -lcrypto -lz -ldl)

set_source_files_properties(${build_target} PROPERTIES
       COMPILE_FLAGS  "${EXTRA_OPTIONS}")

SET_TARGET_PROPERTIES(${build_target} PROPERTIES LINKER_LANGUAGE CXX)

SET_TARGET_PROPERTIES(${build_target} PROPERTIES CXX_STANDARD 17)

add_custom_command(TARGET ${build_target} POST_BUILD 
                   COMMAND ${CMAKE_COMMAND} -E copy 
				   $<TARGET_FILE:${build_target}> 
				   ${BIN_PATH}/$(Configuration)/$<TARGET_FILE_NAME:${build_target}>
				   )

#add_test(demo1 ${build_target} COMMAND ${build_target})
